<?php get_header(); ?>

<div id="main" class="archives">
  <?php type_description(); ?>
  <?php if( have_posts() ): while( have_posts() ): the_post();?>
  <div class="entry">
    <h2 class="entry-title"><a href="<?php the_permalink();?>" rel="bookmark" title="Permalink to <?php the_title();?>">
      <?php the_title();?>
      </a></h2>
    <div class="entry-etc"> <span class="entry-link"><?php echo substr(get_permalink(),7);?></span> <span>&nbsp;-&nbsp;</span> <span class="entry-date"><?php echo time_since(get_the_time('U'));?></span> <span>&nbsp;-&nbsp;</span> <span>
      <?php the_category(',');?>
      </span> <span>&nbsp;-&nbsp;</span> <span>
      <?php comments_popup_link('暂无评论', '1条评论', '%条评论' ); ?>
      </span> </div>
    <div class="entry-content">
      <?php the_excerpt();?>
    </div>
  </div>
  <?php endwhile;?>
  <div class="clear"></div>
  <div class="page_navi">
    <?php pagenavi(9); ?>
  </div>
  <?php else: ?>
  <div class="entry">
    <div class="entry-title">
      <h2>
      没有结果
      </h2>
    </div>
    <div class="entry-content">
      <?php if(!empty($GLOBALS['option']['google_custom'])):?>
      <p>没有直接结果，请试试Google自定义搜索，输入关键词并稍等片刻。</p>
<div id="cse" style="width: 100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript"> 
  google.load('search', '1', {language : 'zh-CN'});
  google.setOnLoadCallback(function() {
    var customSearchControl = new google.search.CustomSearchControl('<?php echo $GLOBALS['option']['google_custom']?>');
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    var options = new google.search.DrawOptions();
    options.setAutoComplete(true);    
    customSearchControl.draw('cse', options);
  }, true);
</script>
<link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" />
      <?php endif;?>
    </div>
  </div>
  <?php endif;?>
</div>
<div id="lbar">
  <?php get_template_part("sidebar_l","index");?>
</div>
<div id="rbar">
  <?php get_template_part("sidebar_r","index");?>
</div>
<?php get_footer(); ?>
